from pydantic_settings import BaseSettings, SettingsConfigDict
from typing import List, Optional

class Settings(BaseSettings):
    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding='utf-8',
        extra="ignore"
    )

    APP_NAME: str = "gptde-2api"
    APP_VERSION: str = "1.1.0"
    DESCRIPTION: str = "一个将 gptde.de 网站功能转换为兼容 OpenAI 格式 API 的高性能代理 (稳定单凭证版)。"

    # --- 认证与安全 ---
    API_MASTER_KEY: Optional[str] = None
    
    # --- gptde.de 认证信息 (直接从 .env 读取) ---
    COOKIE: Optional[str] = None
    NONCE: Optional[str] = None
    CLIENT_ID: Optional[str] = None

    # --- 请求与端口配置 ---
    API_REQUEST_TIMEOUT: int = 180
    NGINX_PORT: int = 8089

    # --- 模型定义 (根据抓包数据确定) ---
    KNOWN_MODELS: List[str] = [
        "gpt-4o-mini-2024-07-18"
    ]

settings = Settings()
